function Calculate() {
	if(($('#amount_box').raw().value *1024*1024) > $('#current_uploaded').raw().value) {
		$('#new_uploaded').raw().innerHTML = "You can't afford that request!";
		$('#new_bounty').raw().innerHTML = "0.00 MB";
		$('#button').remove();
	} else if(!($('#amount_box').raw().value > 0) || isNaN($('#amount_box').raw().value)) {
		$('#new_uploaded').raw().innerHTML = get_size(($('#current_uploaded').raw().value));
		$('#new_bounty').raw().innerHTML = "0.00 MB";
		$('#button').remove();
	} else {
		if($('#request_form').raw() && !$('#button').raw()) {
			var button = document.createElement("input");
			button.id = "button";
			button.type = "submit";
			button.value= "Vote!";
			$('#request_form').raw().appendChild(button);
		}
		$('#amount').raw().value = $('#amount_box').raw().value;
		$('#new_uploaded').raw().innerHTML = get_size(($('#current_uploaded').raw().value) - (1024*1024 * $('#amount_box').raw().value));
		$('#new_ratio').raw().innerHTML = ratio($('#current_uploaded').raw().value - (1024*1024 * $('#amount_box').raw().value), $('#current_downloaded').raw().value);
		$('#new_bounty').raw().innerHTML = get_size(1024*1024 * $('#amount_box').raw().value);
	}
}

var ArtistCount = 1;

function AddArtistField() {
		if (ArtistCount >= 100) { return; }
		var ArtistField = document.createElement("input");
		ArtistField.type = "text";
		ArtistField.id = "artist";
		ArtistField.name = "artists[]";
		ArtistField.size = 45;
		
		var ImportanceField = document.createElement("select");
		ImportanceField.id = "importance";
		ImportanceField.name = "importance[]";
		ImportanceField.options[0] = new Option("Main", "1");
		ImportanceField.options[1] = new Option("Guest", "2");
		
		var x = $('#artistfields').raw();
		x.appendChild(document.createElement("br"));
		x.appendChild(ArtistField);
		x.appendChild(ImportanceField);
		ArtistCount++;
}

function RemoveArtistField() {
		if (ArtistCount == 1) { return; }
		var x = $('#artistfields').raw();
		for (i=0; i<3; i++) { x.removeChild(x.lastChild); }
		ArtistCount--;
}

function Categories() {
	if($('#categories').raw().options[$('#categories').raw().selectedIndex].value == "Music") {
		$('#artist_tr').show();
	} else {
		$('#artist_tr').hide();
	}
}